import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.fastjson2.JSON;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

public class MTToJDData {

    public static void main(String args[]){
        //
        List<MTProduct> mtProductList = EasyExcel.read("D:\\work\\sxkj\\ruoyi-project\\src\\test\\resources\\mt-data.xls")
                .doReadAllSync();
        String str = JSON.toJSONString(mtProductList);
        //System.out.println(str);
        List<JDTemplate> jdDataList = new ArrayList<>();
        mtProductList.forEach(mtProduct -> {
            JDTemplate jdTemplate = new JDTemplate();
            jdTemplate.setFirstRow("");
            jdTemplate.setProductName(mtProduct.getItemName());
            jdTemplate.setProductCategoryId(24999L);
            jdTemplate.setProductWeight(new BigDecimal(0.1));
            jdTemplate.setProductPrice(new BigDecimal(mtProduct.getPrice()));
            jdTemplate.setPrimaryClassification(EmojiUtils.filterEmoji(mtProduct.getCategoryName()));
            jdTemplate.setSkuCode(mtProduct.getSkuCode());
        });


    }


}
